﻿using System.Collections.Generic;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;

namespace System.ServiceManager.Facade.ExtensionMethods
{
    public static partial class ExtensionMethods
    {

        //ManagementPackClass connectorClass = connectorManagementPack.GetClass(ConnectorManagementPackName);

        // this is an instantiation
        //var connectorObject = new CreatableEnterpriseManagementObject(SCSMServer.CurrentManagementGroup, connectorClass);

        public static CreatableEnterpriseManagementObject CreateInstance (this ManagementPackClass mpc)
        {
           return new CreatableEnterpriseManagementObject(SCSMServer.CurrentManagementGroup, mpc);
        }


        public static string CreateWeeklyDailySchedule(this ManagementPackDataSourceModule module, IList<WeeklyDays> weeklyDays)
        {

            return new WeeklyDailySchedule(weeklyDays).ScheduleXml;

        }

        public static string CreateWeeklyMultipleDaysSchedule(this ManagementPackDataSourceModule module, IList<WeeklyMultipleDays> weeklyDays)
        {

            return new WeeklyMultipleDaysSchedule(weeklyDays).ScheduleXml;

        }

        public static string CreateSimpleSchedule(this ManagementPackDataSourceModule module, int timeInterval, IntervalUnitsType intervalUnitsType)
        {

            return new SimpleReccuringSchedule(timeInterval, intervalUnitsType).ScheduleXml;

        }

        //WeeklyMultipleDaysSchedule

         
    }
}
